package VN.EDU.IMIC.DEVELOPER.TRANTHITHANHNGA.ARRAY.EX3;

public class Models {
/** Finding smallest element
 * @param int[]arr
 * @return smallest element
 */
	public int min(int[]arr){
		int min =0;
		for (int i = 0; i<arr.length; i++){
			if(min>arr[i]){
				min = arr[i];
			}
		}
		return min;
	}
	
	public int iMin(int[]arr, int min){
		int iMin=0;
		for(int i=0; i<arr.length;i++){
			if(arr[i]==min){
				iMin =i;
			}
		}
		return iMin;
	}
}
